from GameControl import GameControl

gameControl=GameControl()  #创建游戏控制器对象

gameNameList=gameControl.getGameNameList()
gameNum=0
gameCount=len(gameNameList)

while gameNum!= str(gameCount+2):
    num = 0
    for item in gameNameList:
        num+=1
        print(str(num)+"."+item)
    num+=1
    print(str(num)+".统计游戏结果")
    num+=1
    print(str(num)+".退出")
    gameNum=input("请输入选择的项目号：")

    if gameNum in [str(x) for x in range(1,gameCount+1)] :
        gameControl.beginPlay(eval(gameNum))
    elif gameNum==str(gameCount+1) :
        gameControl.printStat()
